<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>提交试卷 - 智能教育系统</title>
    <script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="bg-gradient-to-br from-blue-50 to-indigo-100 min-h-screen">
    <!-- 引入导航栏 -->
    <div th:replace="fragments/navbar :: navbar"></div>

    <div class="container mx-auto px-4 py-8">
        <div class="max-w-2xl mx-auto bg-white rounded-lg shadow-lg p-6">
            <h2 class="text-2xl font-bold text-gray-800 mb-6">提交试卷</h2>

            <!-- 考试信息 -->
            <div class="mb-6 p-4 bg-gray-50 rounded-lg">
                <h3 class="text-lg font-semibold text-gray-700 mb-2" th:text="${exam.examName}">考试名称</h3>
                <div class="grid grid-cols-2 gap-4 text-sm text-gray-600">
                    <div>
                        <span class="font-medium">科目：</span>
                        <span th:text="${exam.subject}">科目</span>
                    </div>
                    <div>
                        <span class="font-medium">考试日期：</span>
                        <span th:text="${#temporals.format(exam.examDate, 'yyyy-MM-dd')}">日期</span>
                    </div>
                    <div>
                        <span class="font-medium">班级：</span>
                        <span th:text="${exam.classEntity.className}">班级</span>
                    </div>
                    <div>
                        <span class="font-medium">年级：</span>
                        <span th:text="${exam.classEntity.grade}">年级</span>
                    </div>
                </div>
            </div>

            <!-- 提交表单 -->
            <form th:action="@{/exam-submit}" method="post" enctype="multipart/form-data" class="space-y-6">
                <input type="hidden" name="examId" th:value="${exam.id}">
                
                <div>
                    <label class="block text-sm font-medium text-gray-700 mb-2">上传试卷图片</label>
                    <input type="file" name="examImage" accept="image/*" required
                           class="w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-blue-500">
                    <p class="mt-1 text-sm text-gray-500">请上传清晰的试卷图片，支持 JPG、PNG 格式</p>
                </div>

                <div class="flex justify-end space-x-4">
                    <a th:href="@{/exam/list}" 
                       class="px-4 py-2 border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
                        取消
                    </a>
                    <button type="submit" 
                            class="px-4 py-2 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
                        提交试卷
                    </button>
                </div>
            </form>
        </div>
    </div>
</body>
</html> 